<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
     if (NaN || 0 || null || "" || undefined || [] || {} || "0") {
        alert(1);
      } else {
    alert(2)
}
// 在js中if条件为null/undefined/0/NaN/""表达式时，统统被解释为false,此外均为true
  </script>
</body>
</html>